package wan.com.templateproject.api;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import wan.com.templateproject.entity.People;
import wan.com.templateproject.mapper.impl.PeopleMapperImpl;

import java.util.List;

/**
 * @author wan
 * @version 1.0.0
 * @Description TODO
 * @createTime 2021年08月18日 09:30:05
 */
@RestController
@RequestMapping("/people")
public class PeopleApi {

    @Autowired
    private PeopleMapperImpl peopleMapper;

    @PostMapping("/add/people")
    public boolean addPeople(@RequestBody People people) {
        return peopleMapper.insertPeople(people);
    }
    @PostMapping("/delete/people")
    public boolean deletPeople(@RequestBody People people) {
        return peopleMapper.deletePeople(people);
    }
    @PostMapping("/update/people")
    public boolean updatePeople(@RequestBody People people) {
        return peopleMapper.updatePeople(people);
    }
    @PostMapping("/get/people")
    public List<People> getPeople(@RequestBody People people) {
        return peopleMapper.getPeople(people);
    }
}
